#ifndef GLOBAL_H
#define GLOBAL_H


typedef struct
{
  uint8_t bit0:1;
  uint8_t bit1:1;
  uint8_t bit2:1;
  uint8_t bit3:1;
  uint8_t bit4:1;
  uint8_t bit5:1;
  uint8_t bit6:1;
  uint8_t bit7:1;
}io_reg;

#define BIT_up                  ((volatile io_reg*)_SFR_MEM_ADDR(TWAR))->bit0 
//#define BIT_recv_error          ((volatile io_reg*)_SFR_MEM_ADDR(TWAR))->bit1 
//#define BIT_active              ((volatile io_reg*)_SFR_MEM_ADDR(TWAR))->bit2 
//#define BIT_use_sample1         ((volatile io_reg*)_SFR_MEM_ADDR(TWAR))->bit3 

//#define BIT_byte_count          ((volatile io_reg*)_SFR_MEM_ADDR(TWAR))->bit4 
//#define BIT_receive_132         ((volatile io_reg*)_SFR_MEM_ADDR(TWAR))->bit5 
//#define BIT_wait_uart_low       ((volatile io_reg*)_SFR_MEM_ADDR(TWAR))->bit6 
//#define BIT_RS232_calibrated    ((volatile io_reg*)_SFR_MEM_ADDR(TWAR))->bit7 

#define true 0x01 
#define false 0x0

#define BAUD_RATE 9600

#endif
